package com.hnevc.mukewangapp;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;


public class MainActivity extends AppCompatActivity {
    HomeFragment homeFragment;
    AccountFragment accountFragment;
    NotesFragment notesFragment;
    StudentsFragment studentsFragment;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        homeFragment = new HomeFragment();
        notesFragment = new NotesFragment();
        studentsFragment = new StudentsFragment();
        accountFragment = new AccountFragment();
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.container,homeFragment)
                .commit();

    }

    public void home(View view) {
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.container,homeFragment)
                .commit();
    }

    public void notes(View view) {
        getSupportFragmentManager().beginTransaction().replace(R.id.container,notesFragment).commit();
    }

    public void students(View view) {
        getSupportFragmentManager().beginTransaction().replace(R.id.container,studentsFragment).commit();
    }

    public void account(View view) {
        getSupportFragmentManager().beginTransaction().replace(R.id.container,accountFragment).commit();
    }
}
